package tn.insat.iac;

import java.util.ArrayList;
import java.util.List;

import tn.insat.iac.mock.MockService;
import tn.insat.iac.model.Friend;
import tn.insat.iac.service.FriendService;
import tn.insat.iac.service.imp.FriendServiceImp;
import android.app.ListActivity;
import android.os.Bundle;
import android.widget.ArrayAdapter;

public class FriendList extends ListActivity {

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);

		ArrayList<String> names = new ArrayList<String>();

		FriendService service = new MockService();
		List<Friend> Friends = service.getAllFriends();

		for (Friend friend : Friends) {
			names.add(friend.getNom() + " " + friend.getPrenom());
		}
		setListAdapter(new ArrayAdapter<String>(this,
				android.R.layout.simple_list_item_1, names));

	}
}